from .AIAssistant import AIAssistant

class DataAnalysisAssistant(AIAssistant):
    """数据分析助手类，专门用于处理数据分析相关任务"""
    
    def __init__(self, id, name, version, online, score, data_format, has_visualization):
        super().__init__(id, name, "数据分析助手", version, online, score)
        self._data_format = data_format
        self._has_visualization = has_visualization
    
    # Getter和Setter方法
    @property
    def data_format(self):
        return self._data_format
    
    @data_format.setter
    def data_format(self, data_format):
        self._data_format = data_format
    
    @property
    def has_visualization(self):
        return self._has_visualization
    
    @has_visualization.setter
    def has_visualization(self, has_visualization):
        self._has_visualization = has_visualization
    
    def process_task(self, task_content):
        """处理数据分析任务"""
        print(f"正在为【{self.name}】分配数据分析任务：{task_content}")
        
        # 模拟数据分析处理过程
        visualization = "（包含数据可视化）" if self._has_visualization else ""
        self.status_message = f"数据分析完成：{task_content}{visualization}"
        print(f"✅ {self.status_message}")
        return True
    
    def display_info(self):
        """显示助手的详细信息"""
        super().display_info()
        print(f"   支持的数据格式: {self._data_format}")
        print(f"   是否支持可视化: {'是' if self._has_visualization else '否'}")